<!--
 * @Author: zengwj
 * @Date: 2022-07-01 14:21:54
 * @LastEditors: zengwj
 * @LastEditTime: 2022-07-01 15:45:37
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function outputNumbers(count) {
      for (var i = 0; i < count; i++) {
        console.log(i)
      }
      alert(i)
    }
    outputNumbers(10)

    function MyObject() {
      // 私有变量和私有函数
      var privateVariable = 10;
      function privateFunction() {
        return false;
      }
      // 特权方法
      this.publicMethod = function () {
        privateVariable++;
        return privateFunction()
      }
    }
    const newObj = new MyObject()
    const a = newObj.publicMethod()
    console.log(a)
  </script>
</body>

</html>